home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / gawk-3.000 / gawk-3 / gawk-3.0.0 / atari / Makefile.st < prev    next >
Encoding:
Makefile  |  1995-12-29  |  6.5 KB  |  244 lines

  1. # Makefile for GNU Awk - ST version.
  2. #
  3. # This makefile hand edited from Makefile automatically generated
  4. # by configure - gcc 2.x.x compiler with TOS version of libraries
  5. # and modified system().
  6. # Check comments in this Makefile and adjust to your needs!!
  7. #
  8. # This Makefile assumes that you are using Bourne compatible shell
  9. # (like bash). If this is not the case you will have to edit various
  10. # targets or perform some actions by hand.
  11. #
  12. # Copyright (C) 1986, 1988-1995 the Free Software Foundation, Inc.
  13. # This file is part of GAWK, the GNU implementation of the
  14. # AWK Programming Language.
  15. # GAWK is free software; you can redistribute it and/or modify
  16. # it under the terms of the GNU General Public License as published by
  17. # the Free Software Foundation; either version 2 of the License, or
  18. # (at your option) any later version.
  19. # GAWK is distributed in the hope that it will be useful,
  20. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22. # GNU General Public License for more details.
  23. # You should have received a copy of the GNU General Public License
  24. # along with this program; if not, write to the Free Software
  25. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
  26.  
  27.  
  28.  
  29. srcdir = .
  30.  
  31. # native compiler with freshly compiled gawk.ttp to fix awklib
  32. CC = gcc
  33. GAWK=../gawk.ttp
  34. # cross-compiler and gawk already installed on the system (any awk will do)
  35. # CC = cgcc
  36. # GAWK = gawk
  37. # WIDTH and EXT have to be both defined or both undefined
  38. # WIDTH = -mshort -DINT_IS_16BIT
  39. # EXT = 16
  40. OFLAGS = -O2 -Wall -fomit-frame-pointer $(WIDTH)
  41. LDFLAGS = $(WIDTH)
  42. YACC = bison -y
  43.  
  44. INSTALL = cp -p
  45. INSTALL_PROGRAM = ${INSTALL}
  46. #INSTALL_DATA = ${INSTALL} -m 644
  47. INSTALL_DATA = ${INSTALL}
  48.  
  49. LIBS = -lpml$(EXT)
  50.  
  51. ALLOCA = 
  52.  
  53. #all these definitions likely require changes
  54. exec_prefix = ${prefix}
  55. prefix = /usr/local
  56. binprefix =
  57. manprefix =
  58.  
  59. bindir = $(exec_prefix)/bin
  60. libdir = $(exec_prefix)/lib
  61. manexta = l
  62. mandir = $(prefix)/man$(manexta)
  63. manext = .$(manexta)
  64. infodir = $(prefix)/info
  65. datadir = $(prefix)/lib/awk
  66. libexecdir = $(prefix)/libexec/awk
  67.  
  68. #DEFPATH = ".:$(datadir)"
  69. # datadir is passed to the next Makefile level and through sed
  70. # you may need many more backslashes than that if you have to use
  71. # them at all - sigh...
  72. DEFPATH = ".,c:\\lib\\awk,c:\\gnu\\lib\\awk"
  73.  
  74. SHELL = /bin/sh
  75. CFLAGS = $(OFLAGS) -DGAWK -I. -I$(srcdir) -DHAVE_CONFIG_H
  76.  
  77. MFLAGS = "CC=$(CC)" "CFLAGS=$(CFLAGS) $(LDFLAGS)" GAWK=$(GAWK) \
  78.   PWCAT=pwcat.ttp GRCAT=grcat.ttp GCOM='{sub(/\":\"/, "\",\""); print}' \
  79.   "INSTALL_PROGRAM=$(INSTALL)" "INSTALL_DATA=$(INSTALL)" \
  80.   "bindir=$(bindir)" \
  81.   "libdir=$(libdir)" \
  82.   "mandir=$(mandir)" \
  83.   "infodir=$(infodir)" \
  84.   "datadir=$(datadir)" \
  85.   "libexecdir=$(libexecdir)"
  86.  
  87. # object files
  88. AWKOBJS = array.o builtin.o eval.o field.o gawkmisc.o io.o main.o \
  89.     missing.o msg.o node.o re.o version.o
  90.  
  91. ALLOBJS = $(AWKOBJS) awktab.o
  92.  
  93. # GNUOBJS
  94. #    GNU stuff that gawk uses as library routines.
  95. GNUOBJS= getopt.o getopt1.o regex.o dfa.o $(ALLOCA)
  96.  
  97. # source and documentation files
  98. SRC = array.c builtin.c eval.c field.c gawkmisc.c io.c main.c \
  99.     missing.c msg.c node.c re.c version.c
  100.  
  101. ALLSRC= $(SRC) awktab.c
  102.  
  103. AWKSRC= awk.h awk.y $(ALLSRC) patchlevel.h protos.h
  104.  
  105. GNUSRC = alloca.c dfa.c dfa.h regex.c regex.h getopt.h getopt.c getopt1.c
  106.  
  107. DOCS= doc/gawk.1.in doc/gawk.texi.in doc/texinfo.tex
  108.  
  109. TEXFILES= doc/gawk.aux doc/gawk.cp doc/gawk.cps doc/gawk.fn doc/gawk.fns \
  110.       doc/gawk.ky doc/gawk.kys doc/gawk.pg doc/gawk.pgs doc/gawk.toc \
  111.       doc/gawk.tp doc/gawk.tps doc/gawk.vr doc/gawk.vrs
  112.  
  113. ALLDOC= doc/gawk.dvi $(TEXFILES) doc/gawk.info*
  114.  
  115. # Release of gawk.  There can be no leading or trailing white space here!
  116. REL=3.0
  117. PROG=gawk.ttp
  118.  
  119. # clear out suffixes list
  120. .SUFFIXES:
  121. .SUFFIXES: .c .o
  122.  
  123. .c.o:
  124.     $(CC) -c $(CFLAGS) $<
  125.  
  126. # rules to build $(PROG)
  127. all:    $(PROG) awklib/all
  128.  
  129. alldoc:    all doc/all
  130.  
  131. $(PROG):    $(ALLOBJS) $(GNUOBJS) $(REOBJS)
  132.     $(CC) -o $@ $(LDFLAGS) $(ALLOBJS) $(GNUOBJS) $(REOBJS) $(LIBS)
  133. #    toglclr -fload $@
  134. #    xstrip -k $@
  135.  
  136.  
  137. $(ALLOBJS):    awk.h dfa.h regex.h config.h custom.h
  138.  
  139. $(GNUOBJS):    config.h custom.h
  140.  
  141. gawkmisc.o:    $(srcdir)/atari/gawkmisc.atr
  142.         $(CC) -c  -DDEFPATH='$(DEFPATH)' $(CFLAGS) $(srcdir)/$<
  143.  
  144. # this rule needed or not - depending on your library
  145. missing.o io.o:    
  146.     $(CC) -c $(CFLAGS) -DPIPES_SIMULATED $(srcdir)/$<
  147.  
  148. # cheat with defines to force an inclusion of a proper code
  149. getopt.o:    getopt.h
  150.     $(CC) $(CFLAGS) -D_LIBC -D__alloca=__builtin_alloca -c getopt.c
  151.   
  152. getopt.o:    getopt.h
  153.  
  154. getopt1.o:    getopt.h
  155.  
  156. main.o:    patchlevel.h
  157.  
  158. awktab.c:    awk.y
  159.     $(YACC) -v $(srcdir)/awk.y && \
  160.     if test -f y.tab.c ; then mv y.tab.c ytab.c ; else true ; fi && \
  161.     sed '/^extern char .malloc(), .realloc();$$/d' ytab.c >awktab.c && \
  162.     rm ytab.c
  163.  
  164. # VMS POSIX make won't apply the default .c.o rule to awktab.o for some reason
  165. awktab.o:    awktab.c awk.h
  166.     $(CC) -c $(CFLAGS) $(srcdir)/awktab.c
  167.  
  168. alloca.o:    alloca.c
  169.  
  170. install:    $(PROG)
  171.     $(INSTALL) $(PROG) $(bindir) && chmod 755 $(bindir)/$(PROG)
  172.     cd awklib && $(MAKE) $(MFLAGS) install
  173. #    cd doc && $(MAKE) $(MFLAGS) install
  174.  
  175. installdoc:    info
  176.     cd doc && $(MAKE) $(MFLAGS) install
  177.  
  178. #    
  179. #installtotal:    installdirs install installdoc
  180.  
  181.  
  182. installdirs: mkinstalldirs
  183.     $(srcdir)/mkinstalldirs $(bindir) $(datadir) \
  184.         $(libdir) $(infodir) $(mandir)
  185.  
  186. uninstall:
  187.     rm -f $(bindir)/$(PROG)
  188.     cd awklib && $(MAKE) $(MFLAGS) uninstall
  189. #    cd doc && $(MAKE) $(MFLAGS) uninstall
  190.  
  191. clean:
  192.     rm -rf $(PROG) *.o core y.output
  193.     cd awklib && $(MAKE) $(MFLAGS) clean
  194. # the following does not always make sense (when crosscompiling)
  195. #    cd test && $(MAKE) $(MFLAGS) clean
  196. #    cd doc && $(MAKE) $(MFLAGS) clean
  197.  
  198.  
  199. distclean:    clean
  200.     rm -f Makefile *.orig *.rej */*.orig */*.rej awk.output gmon.out \
  201.         make.out config.h config.status config.cache config.log stamp-h stamp-h.in
  202.     cd doc && $(MAKE) $(MFLAGS) distclean
  203.  
  204. mostlyclean:    clean
  205.  
  206. maintainer-clean:    distclean
  207.     @echo "This command is intended for maintainers to use;"
  208.     @echo "it deletes files that may require special tools to rebuild."
  209.     rm -f awktab.c
  210.     cd doc && $(MAKE) $(MFLAGS) maintainer-clean
  211.     cd test && $(MAKE) $(MFLAGS) maintainer-clean
  212. #    cd awklib && $(MAKE) $(MFLAGS) maintainer-clean
  213.  
  214. clobber:    maintainer-clean
  215.  
  216. TAGS:
  217.     etags $(AWKSRC)
  218.     ctags $(AWKSRC)
  219.  
  220. dvi:    $(srcdir)/doc/gawk.texi.in
  221.     cd doc && $(MAKE) $(MFLAGS) dvi
  222.  
  223. info:    $(srcdir)/doc/gawk.texi.in
  224.     cd doc && $(MAKE) $(MFLAGS) info
  225.  
  226. doc/all:
  227.     cd doc && $(MAKE) $(MFLAGS) all
  228.  
  229. awklib/all:
  230.     cd awklib && $(MAKE) $(MFLAGS) all
  231.  
  232. # to run this target you have to adjust test/Makefile quite a bit
  233. # in order to make it paltable to your shell
  234. #
  235. check:    $(PROG)
  236.     cd test; $(MAKE) -k
  237.  
  238. test:    check
  239.  
  240.